<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>号码生成链接</title>
	

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/mhDoLbDldZc3qpsJHpLogda//BVZbgYuw6kof4u2FrCedxOtgRZDTHgHUhOCVim" crossorigin="anonymous"></script>

<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>

 <div class="alert alert-danger" role="alert" style="text-align: center;">
  一定要先登录！
  提前点进去，到时间直接点预约！
</div>
<div id="app">

	<table class="table">
	  <thead>
	    <tr>
	      <th scope="col">cid编号</th>
	      <th scope="col">微信号</th>
	      <th scope="col">姓名</th>
	      <th scope="col">预约时间</th>
	      <th scope="col">星期</th>
	      <th scope="col">跳转链接1</th>
	      <th scope="col">跳转链接2</th>
	    </tr>
	  </thead>
	  <tbody>
		<tr v-for="item in items">
	      <th scope="row">{{ item.cid }}</th>
	      <td>{{ item.wx }}</td>
	      <td>{{ item.name }}</td>
	      <td>{{ days }}</td>
	      <td>{{ week }}</td>
	      <td><a href="http://yixinwenhua.situjia.top/wap/yvyue/yvyueok/cid/{{ item.cid }}/ban_id/{{banid1}}/yy_jz_time/{{ days }}.html">8:30-9:30</a></td>
	      <td><a href="http://yixinwenhua.situjia.top/wap/yvyue/yvyueok/cid/{{ item.cid }}/ban_id/{{banid2}}/yy_jz_time/{{ days }}.html">9:30-10:30</a></td>
	    </tr>
	  </tbody>
	</table>
</div>

<script type="text/javascript">
	
	//import { createApp } from 'vue'
// const app = createApp({
//   data() {
//     return {
//       count: 0,
//       items : "value", ref([{ message: 'Foo' }, { message: 'Bar' }])
//     }
//   }
// }).mount('#app')
// const items = ref([{ message: 'Foo' }, { message: 'Bar' }])
function buling(num){

	if(num.toString().length < 2){
		return '0'+num
	}else{
		return num
	}
}
function timstemp(day){
	var today = new Date();
	var targetday_milliseconds=today.getTime() + 1000*60*60*24*day;
	today.setTime(targetday_milliseconds); 
	return today;
}
function getDay(day){
	var today = timstemp(day)
	//注意，这行是关键代码
	var tYear = today.getFullYear();
	var tMonth = today.getMonth();
	var tDate = today.getDate();
	tMonth = this.doHandleMonth(tMonth + 1);
	tDate =  this.doHandleMonth(tDate);
	return tYear+"-"+buling(tMonth)+"-"+buling(tDate);
}
function banid1(day) {
	 	let days = ["295", "290", "291", "292", "293", "294", "295"];

        var today = timstemp(day);

        let weekday = today.getDay();

        weekDay = days[weekday];
	return weekDay;
}
function banid2(day) {
	 	let days = ["317", "299", "302", "305", "308", "311", "314"];

        var today = timstemp(day);

        let weekday = today.getDay();

        weekDay = days[weekday];
	return weekDay;
}
function weeks(day) {
	 	let days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];

        var today = timstemp(day);

        let weekday = today.getDay();

        weekDay = days[weekday];
	return weekDay;
}
function doHandleMonth(month){
	var m = month;
	if(month.toString().length == 1){
		m =month;
	}
	return m;
}

const { createApp, ref } = Vue

  createApp({
    setup() {
      
      // const week = weeks(6)
      // const banid = ref('312')
	  // const days = getDay(6);
      return {
        days: getDay(6),
        week:weeks(6),
        banid1:banid1(6),
        banid2:banid2(6),
        items:[{ wx:'果汁',name:'付舒雅',cid: '8683' }
        	, { wx:'白海清',name:'白海清',cid: '7932' }
        	,{ wx:'卢慧',name:'卢慧',cid: '7040' }
        	,{ wx:'mrwang',name:'白有生',cid: '7199' }
        	,{ wx:'幸福的旋律',name:'白有枝',cid: '8249' }
        	,{ wx:'郭凤凤',name:'郭计凤',cid: '7322' }]
      }
    }
  }).mount('#app')
</script>
</body>
</html>